<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<div class="items">
	<div class="container">
		<div class="row">
        <div class="span3 hidden-phone">

				<h5 class="title">Danh mục sản phẩm</h5>

				<!-- Sidebar navigation -->
				<nav>
					<ul id="nav">
						<?php
						createListCategory();
						?>
					</ul>
				</nav>
				<br>
			</div>
        <div class="span9">
				<div class="row">
<table width="700" height="500" border="1" cellspacing="1" cellpadding="1">
  <caption>
    <h2>DANH SÁCH ESTORE</h2>
  </caption>
<?php
		$hostname_connect = "localhost";
		$database_connect = "advertisement";
		$username_connect = "root";
		$password_connect = "";	
		$connect = mysql_pconnect($hostname_connect, $username_connect, $password_connect) or trigger_error(mysql_error(),E_USER_ERROR);
		mysql_query("set names 'utf8'");
?>
<?php
mysql_select_db($database_connect, $connect);
$query_detail = "SELECT `estore`.`Logo` , `estore`.`EStoreID`, `estore`.`YahooID` , `estore`.`FavouriteSite1` , `estore`.`Visited` , `euser`.`Address` , `euser`.`Phone` , `euser`.`CompanyName` , `euser`.`Representatives` , `province`.`ProvinceName` , `profession`.`ProfessionName`
FROM `estore` , `euser` , `province` , `profession`
WHERE `estore`.`EStoreId` = `euser`.`EUserID`
AND `euser`.`ProvinceID` = `province`.`ProvinceID`
AND `euser`.`ProfessionID` = `profession`.`ProfessionID`";
$detail = mysql_query($query_detail, $connect) or die(mysql_error());
$row_detail = mysql_fetch_assoc($detail);
$totalRows_detail = mysql_num_rows($detail);
?>
  <?php
        if (isset($row_detail) && is_array($row_detail)) {
          do { //Nested repeat
?>
  <tr>
    <th width="250" rowspan="4" scope="col" align="center"><a class="active" href="estoreid.php?id=<?php echo $row_detail['EStoreID']; ?>"><img height="200" src="<?php echo $row_detail['Logo']; ?>" width="200" /></a></th>
    <th width="80" rowspan="4" scope="col"></th>
    <th width="370" scope="col">Công ty: <a class="active" href="estoreid.php?id=<?php echo $row_detail['EStoreID']; ?>"><?php echo $row_detail['CompanyName']; ?></a></th>
  </tr>
  <tr>
    <td><b>Địa chỉ:</b> <?php echo $row_detail['Address']; echo " ( "; echo $row_detail['ProvinceName']; echo " ) ";?></td>
  </tr>
  <tr>
    <td><b>YahooID:</b> <?php echo $row_detail['YahooID']; ?></td>
  </tr>
  <tr>
    <td><b>Phone:</b> <?php echo $row_detail['Phone']; ?></td>
  </tr>
  <tr>
    <td><table id="table_results">
      <thead>
        <tr>
          <th> </th>
          <th><?php echo $row_detail['ProfessionName']; ?></a></th>
        </tr>
      </thead>
    </table></td>
    <td><?php echo $row_detail['Visited']; ?></td>
    <td><b>Representatives:</b> <?php echo $row_detail['Representatives']; ?></td>
  </tr>
  
  <tr>
  <td colspan="3" bgcolor="#009900"><br /></td>
  </tr>
<?php
		}
		  while ($row_detail = mysql_fetch_assoc($detail));
		}
?>
  </table>
  </div>
  </div>
  </div>
  </div>
  </div>
</body>
</html>